﻿using Cheems.Interface.Models.UserManagement;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Cheems.Interface.UserManagement
{
    public interface IUserManagement
    {
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        Task<bool> Login(T_User user);

        /// <summary>
        /// 添加一名用户
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        Task<bool> AddUser(T_User user);

        /// <summary>
        /// 移除一名用户
        /// </summary>
        /// <param name="user"></param>
        /// <returns></returns>
        Task<bool> RemoveUser(T_User user);

        /// <summary>
        /// 查询全部用户
        /// </summary>
        /// <returns></returns>
        Task<List<T_User>> QueryAllUser();

        /// <summary>
        /// 根据条件查询用户
        /// </summary>
        /// <param name="whereExpression"></param>
        /// <returns></returns>
        Task<List<T_User>> QueryUser(Expression<Func<T_User, bool>> whereExpression);

        /// <summary>
        /// 用户登录
        /// </summary>
        event Action<T_User> OnUserLogin;

        /// <summary>
        /// 消息提醒
        /// </summary>
        event Action<string> OnMessageReminder;

        /// <summary>
        /// 用户信息发生改变：增删改都算
        /// </summary>
        event Action<List<T_User>> OnUserInfoChanged;
    }
}
